Skip to content

Remove .md from links using ReMark plugin#689

Merged
maartenba merged 9 commits into
mainfrom
markdown-extensions-support
Apr 25, 2025
Merged

Remove .md from links using ReMark plugin#689
maartenba merged 9 commits into
mainfrom
markdown-extensions-support

Conversation

@khalidabuhakmeh
Copy link
Copy Markdown
Contributor

@khalidabuhakmeh khalidabuhakmeh commented Apr 24, 2025

Summary of Changes

  • Added a ReHype plugin to automatically strip .md file extensions from links.
  • Configured the content directory to a root path to improve path checking and validation in WebStorm.

Implementation Details

  • Utilized ReHype for processing links during content transformation.
  • Enhanced development experience by enabling proper path validation.

Screenshot In Action

CleanShot 2025-04-24 at 13 38 45@2x

Not sure we want logging, but it's there for now.

This uses ReHype to remove the `.md` file extension. Also set the content directory to a root path for WebStorm so you get proper path checking and validation when authoring.
@khalidabuhakmeh khalidabuhakmeh self-assigned this Apr 24, 2025
@khalidabuhakmeh khalidabuhakmeh added the enhancement New feature or request label Apr 24, 2025
khalidabuhakmeh and others added 2 commits April 24, 2025 13:40
Support for `.md`, `.mdx`, and `index.md(x)` variations. This should make it easier to link things moving forward.
@khalidabuhakmeh
Copy link
Copy Markdown
Contributor Author

@maartenba I noticed the lychee link checker is running over the markdown files :( This means it's not accurately determining if a link is valid.

ReHyper operates on the HTML, while ReMark processes the Markdown, giving us an opportunity to clean up links before they are processed and link checked.
Introduce the `ignoreRelativeLinks` option to the `removeMarkdownExtensions` plugin, allowing users to bypass processing for relative links. Updated `astro.config.mjs` to enable this option by default.
@khalidabuhakmeh khalidabuhakmeh changed the title Remove .md from links using ReHype plugin Remove .md from links using ReMark plugin Apr 24, 2025
@maartenba maartenba merged commit c64b84b into main Apr 25, 2025
4 of 5 checks passed
@maartenba maartenba deleted the markdown-extensions-support branch April 25, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants